# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=font-noto-cjk
pkgver=0_git20211026
_commit=9f7f3c38eab63e1d1fddd8d50937fe4f1eacdb1d
pkgrel=0
pkgdesc="Google's font family that aims to support all the world's languages (cjk)"
url="https://github.com/googlefonts/noto-fonts/"
arch="noarch"
license="OFL-1.1"
depends="fontconfig"
options="!check"
subpackages="$pkgname-extra:_extra"
source="https://github.com/googlefonts/noto-cjk/archive/$_commit/noto-cjk-$_commit.tar.gz"
builddir="$srcdir/noto-cjk-$_commit"

package() {
	mkdir -p "$pkgdir"/usr/share/fonts/noto
	for font in NotoSansCJK-Bold.ttc \
		NotoSansCJK-Regular.ttc \
		NotoSerifCJK-Bold.ttc \
		NotoSerifCJK-Regular.ttc
	do
		install -m644 "$builddir"/*/OTC/"$font" \
			"$pkgdir"/usr/share/fonts/noto/"$font"
	done
}

_extra() {
	mkdir -p "$subpkgdir"/usr/share/fonts/noto
	for font in NotoSansCJK-Black.ttc \
		NotoSansCJK-DemiLight.ttc \
		NotoSansCJK-Light.ttc \
		NotoSansCJK-Medium.ttc \
		NotoSansCJK-Thin.ttc \
		NotoSerifCJK-Black.ttc \
		NotoSerifCJK-ExtraLight.ttc \
		NotoSerifCJK-Light.ttc \
		NotoSerifCJK-Medium.ttc \
		NotoSerifCJK-SemiBold.ttc
	do
		install -m644 "$builddir"/*/OTC/"$font" \
			"$subpkgdir"/usr/share/fonts/noto/"$font"
	done
}

sha512sums="
dce2506288ce94301de146fd2317e93dc135f21a3543c1f3a497294eea087270ea036d60ddb7693a784a3fc4b620698bf4eb34527b20bbc52acbf293604051a6  noto-cjk-9f7f3c38eab63e1d1fddd8d50937fe4f1eacdb1d.tar.gz
"
